<template>
  <t-dialog
    header="操作日志详细"
    :visible.sync="visible"
    :onClose="closeDialog"
    :closeOnOverlayClick="false"
    :confirmBtn="null"
    width="40%"
  >
    <t-form ref="form" :colon="true" :data="formData" label-width="100">
      <t-row>
        <t-col :span="12">
          <t-form-item label="操作模块">{{ formData.title }} / {{formData.businessType.toString() | filterByDict(dict.type.sys_oper_type)}}</t-form-item>
        </t-col>
        <t-col :span="12">
          <t-form-item
            label="登录信息"
          >{{ formData.operName }} / {{ formData.operIp }}</t-form-item>
        </t-col>
        <t-col :span="12">
          <t-form-item label="请求地址">{{ formData.operUrl }}</t-form-item>
        </t-col>
        <t-col :span="12">
          <t-form-item label="请求方式">{{ formData.requestMethod }}</t-form-item>
        </t-col>
        <t-col :span="12">
          <t-form-item label="操作方法">{{ formData.method }}</t-form-item>
        </t-col>
        <t-col :span="12">
          <t-form-item label="请求参数">{{ formData.operParam }}</t-form-item>
        </t-col>
        <t-col :span="12">
          <t-form-item label="返回参数">{{ formData.jsonResult }}</t-form-item>
        </t-col>
        <t-col :span="12">
          <t-form-item label="操作状态">
            <div v-if="formData.status === 0">正常</div>
            <div v-else-if="formData.status === 1">失败</div>
          </t-form-item>
        </t-col>
        <t-col :span="12">
          <t-form-item label="操作时间">{{ formData.operTime }}</t-form-item>
        </t-col>
        <t-col :span="24">
          <t-form-item label="异常信息" v-if="formData.status === 1">{{ formData.errorMsg }}</t-form-item>
        </t-col>
      </t-row>
    </t-form>
  </t-dialog>
</template>

<script>
export default {
  name: "oper-detial",
  dicts: ["sys_oper_type"],
  props:{
    formData:{
      type: Object,
      default: () => ({})
    }
  },
  data(){
    return {
      visible: true,
    }
  },
  methods:{
    closeDialog() {
      this.$emit("update:visible", false);
    },
  }
}
</script>

<style scoped>

</style>
